#ifndef __CVECTOR4DH_H__
#define __CVECTOR4DH_H__

#include "StdDefs.h"
#include "CMathFixed.h"
#include "CVector3d.h"



// CVector4dh* must maintain casting ability with (fixed*).
// CVector4dh may not have virtuals or instantiated data.



class CVector4dh : public CVector3d
{
public:
	friend class CMatrix4dh;

public:
	CVector4dh(){}
	CVector4dh( boolean wIsClear );
	CVector4dh( fixed ijDegrees, fixed ikDegrees, boolean wIsClear = TRUE );
	CVector4dh( const fixed* ijk, boolean wIsClear = TRUE );
	CVector4dh( fixed i, fixed j, fixed k, boolean wIsClear = TRUE ); 
	CVector4dh( const CVector3d& v, boolean wIsClear = TRUE );
	CVector4dh( const CVector4dh& v, boolean wIsClear = TRUE );
	~CVector4dh(){}

	CVector4dh&			ClearW();
	CVector4dh&			SetW();
	
	boolean				IsWSet() const;

	CVector4dh&			operator=( const CVector3d& v );

//	fixed&				operator[]( uint32 idx );
//	fixed				operator[]( uint32 idx ) const;
	
protected:
	fixed				m_w; 
};




inline
CVector4dh::CVector4dh( boolean wIsClear )
{
	m_w = ( wIsClear )? 0 : CMathFixed::One;
}


inline
CVector4dh&	CVector4dh::ClearW()
{
	m_w = 0;

	return *this;
}


inline
CVector4dh& CVector4dh::SetW()
{
	m_w = CMathFixed::One;

	return *this;
}


inline
boolean CVector4dh::IsWSet() const
{
	return ( m_w ? TRUE : FALSE );
}


//inline
//fixed& CVector4dh::operator[]( uint32 idx )
//{
//	ASSERT( idx < 3 );
//
//	return *( ( (fixed*)this ) + idx );
//}
//
//
//inline
//fixed CVector4dh::operator[]( uint32 idx ) const
//{
//	ASSERT( idx < 4 );
//
//	return *( ( (fixed*)this ) + idx );
//}


 

#endif // __CVECTOR4DH_H__